/*
 * @Description:
 * @Author: cgt
 * @Date: 2021-12-23 14:05:56
 * @LastEditors: cgt
 * @LastEditTime: 2021-12-28 19:47:54
 */
import { randomUUID } from '../../../../mapUtils/RandomUtil';
import CustomLayer from './thematicLayers/CustomLayer';
import FlashPointLayer from './thematicLayers/FlashPointLayer';
import FlowLineLayer from './thematicLayers/FlowLineLayer';
import ITool from '../ITool';
import ScanPointLayer from './thematicLayers/ScanPointLayer';

/**
 * 专题图工具箱
 * @implements {ITool}
 */
class ThematicTool extends ITool {
  constructor(_top, _impl) {
    super(_top, _impl);
    this.name = 'ThematicTool';
    this.desc = '专题图工具箱';
    this.id = randomUUID();
  }

  onAdd() {
    super.onAdd();
  }

  onRemove() {
    super.onRemove();
  }

  /**
   * 创建闪烁点专题图图层
   * @param {Object} options 专题图配置
   */
  FlashPoint(options) {
    let layer = new FlashPointLayer(this, options);
    return layer;
  }

  /**
   * 创建扫描点专题图图层
   * @param {Object} options 专题图配置
   */
  ScanPoint(options) {
    let layer = new ScanPointLayer(this, options);
    return layer;
  }

  /**
   * 创建流动线专题图图层
   * @param {Object} options 专题图配置
   */
  FlowLine(options) {
    let layer = new FlowLineLayer(this, options);
    return layer;
  }

  /**
   * 创建自定义专题图图层
   * @param {Object} options 专题图配置
   * @desc
   * options： {
   *   bindEvents： Array 绑定事件名称
   *   initLayers： Function 初始化图层
   *   refresh： Function 刷新图层（地图移动、缩放时触发）
   * }
   */
  CustomLayer(options) {
    let layer = new CustomLayer(this, options);
    return layer;
  }
}

export default ThematicTool;